<?php
require_once '../lib/controller.php';
require_once '../lib/base.php';

class test extends base
{
	function run()
	{
		$result = '<li>·<a href="http://sc.ifeng.com/event.ng/Type=click&FlightID=21532&AdID=21313&TargetID=457&Segments=1,67,160,490&Targets=196,457&Values=34,46,51,85,100,110,204,223,230,238,261,562,600&RawValues=&Redirect=http://sc.ifeng.com/event.ng/Type=click&FlightID=18260&AdID=18151&TargetID=204&Redirect=http://www.vancl.com/?source=fenghuangsyywsxwzl" target="_blank">VANCL免运费，衬衫T恤99元抢</a>
';

		preg_match_all('/<a[^>]{1,}href=[\'"]{0,1}([^>^ ^" ^\']{1,})[\'"]{0,1}[^>]{0,}>([^>^+]{20,255})<\/a>/i', $result, $text_link);
		print_r($text_link);
		$info = parse_url( $text_link[1][0] );
		$info['path'] = preg_replace( "/&.*/", "", $info['path'] );
		$path = substr($info['path'], 1, strrpos($info['path'], '/') );
		echo $path;
	}

}

$t = new test();
$t->run();
?>